function initTable(){
		$('#table').bootstrapTable({
			title:"用户",
			url:'/user/getUserData',
			pagination:true,
			sidePagination:'server',//设置为服务器端分页
			queryParams:queryParam,
			cache: false,
			pageList: [15,20, 30, 50],
			pageSize:15,
			columns:[{
				field:'realname',
				title:'真实姓名'
			},{
				field:'username',
				title:'账户',
			},{
				field:'roles',
				title:'角色'
			},{
				field:'privileges',
				title:'权限'
			},{
				title:'操作',
				formatter:actFormatter
			}]
		});
}
function queryParam(params){
	var realname = $("#realname").val();
	var role = $("#role").val();
	var privilege = $("#privilege").val();
	var map = {
		limit: params.limit,
		offset:params.offset,
		realname:realname,
		roleId:role,
		privilegeId:privilege
	};
	return map;
	
}
function actFormatter(index, row){
	var id = row.id;
	return '<a class="innerPageLink" href="/user/deleteUser?id='+id+'">删除</a> <a class="innerPageLink" href="/user/editUser?id='+id+'">编辑</a>';
}
function reloadDataTable(){
	$('#table').bootstrapTable("refresh");
}
$(document).ready(function(){
	initTable();
});